www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\inc\ND_models_popwin_content_selecter.asp

    
<%


'**************************************************************
' 新动软网站管理系统
' 官方网站: http://www.aspcpu.com
' 系统作者: 阮丁远(网名:天下程序)
' Copyright 新动软网站管理系统 版权所有
'**************************************************************


%>

<%

dir_set="../"


%>


<!--#include file=conn.asp-->
<!--#include file=Functionb.asp-->

<style>


td {
FONT-SIZE: 12px; 
}

</style>


<%

fielda=request("field")
biaoa=request("biao")
serziduana=request("serziduan")
setishia=request("setishi")





Function get_value_by_id_inbiao(biaonm,id,ziduan) 
on error resume next
err.clear
set rs11xgg=server.CreateObject("adodb.recordset")
rs11xgg.open "select * from "&biaonm&" where id="&id,conn,1,1
if err.number<>0 then
err.clear
get_value_by_id_inbiao="名称字段不存在"
else
if not rs11xgg.eof then
get_value_by_id_inbiao=rs11xgg(ziduan)
else
get_value_by_id_inbiao="此记录不存在"
end if
end if
End Function 



function is_exist_biao_lie(namea,lie)
on error resume next
err.clear
set rs11x=server.CreateObject("adodb.recordset")
       
rs11x.open "select "&lie&" from "&namea,conn,1,1
if err.number<>0 then
is_exist_biao_lie=0
else
is_exist_biao_lie=1
end if
end function


if is_exist_biao_lie(biaoa,"id")<>1 then

%>
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
.STYLE2 {
	color: #000000;
	font-weight: bold;
}
-->
</style>

<br /><br />
<center>
  <strong>发生错误:此数据库表中不存在id字段或不存在所要进行操作的表,所以无法进行操作</strong>
</center>
<%

else
%>


<script language="javascript">
function selit(id,nn){
window.opener.document.getElementById("<%=fielda%>").value=id;
window.opener.document.getElementById("<%=fielda%>_m").value=nn;
window.close(); 
}

</script>


<%
	strFileName="ND_models_popwin_content_selecter.asp?field="&fielda&"&biao="&biaoa&"&serziduan="&serziduana&"&setishi="&setishia
	
%>


<%

page_complied_codes1=page_complied_codes1&"<br><form action='"&strFileName&"' method=post target=_self><div style='border: #999999 solid 1px; margin:3px'><table border=1 bordercolor=#cccccc cellspacing=0 cellpadding=0  align=center>"
page_complied_codes1=page_complied_codes1&"<tr>"

page_complied_codes1=page_complied_codes1&"<td width=60 align=left>&nbsp;[搜索]&nbsp;</td>"

page_complied_codes1=page_complied_codes1&"<td width=140 align=left>&nbsp;请选择被搜索字段:</td>"

page_complied_codes1=page_complied_codes1&"<td align=left><select id='nd_x_beisuoziduan_xz' name='nd_x_beisuoziduan_xz'>"


page_complied_codes1=page_complied_codes1&"<option value='no'>请选择</option>"




   		 set rs21=server.CreateObject("adodb.recordset")
		 rs21.open"select * from "&biaoa&" order by id desc",conn,1,1
   
for zi=0 to rs21.fields.count - 1 
  
  if cstr(rs21.fields(zi).name)=cstr(serziduana) then
  shhhzdmn=setishia
  else
  shhhzdmn=rs21.fields(zi).name
  end if



page_complied_codes1=page_complied_codes1&"<option value='"&rs21.fields(zi).name&"'>"&shhhzdmn&"</option>"



next


page_complied_codes1=page_complied_codes1&"</select>"&"</td><td width=5></td>"

if request("sskey")<>"" then
sskkky=request("sskey")
else
sskkky="请输入搜索关键词"
end if

page_complied_codes1=page_complied_codes1&"<td align=left><div id='sh_key_cont'><input type=text name='sskey' size='18' value='"&sskkky&"'></div></td>"

page_complied_codes1=page_complied_codes1&"<td align=left>"&"<select name='ismohu'><option value='1' selected='selected'>模糊搜索</option><option value='2'>精确搜索</option></select>"&"</td>"

page_complied_codes1=page_complied_codes1&"<td width=58 align=middle><input type=submit value='搜索'></td>"

page_complied_codes1=page_complied_codes1&"</tr>"
page_complied_codes1=page_complied_codes1&"</table></div></form>"



response.write page_complied_codes1

%>

<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder" style="word-break:break-all" bgcolor=#e0e0e0 >
  <tr align="center">
    <td height="26" colspan="40" background="../images/admin_th.gif"><span class="STYLE1">请选择</span></th>
  </tr>
  <tr align="center" bgcolor="#DEDBEF">
  
  <td width="100" bgcolor="#E6E6E6"><span class="STYLE2">选择</span></td>
   <%
   
   		 set rs2=server.CreateObject("adodb.recordset")
		 sql="select * from "&biaoa&" order by id desc"
		 
	 
 rs2.open  sql,conn,1,1	 
		 
   
  for zi=0 to rs2.fields.count - 1 
  
  if cstr(rs2.fields(zi).name)=cstr(serziduana) then
  shhhzdmn=setishia
  else
  shhhzdmn=rs2.fields(zi).name
  end if
  
  %>
 <td width="775" height="25" bgcolor="#F1F4FC"><strong><%=shhhzdmn%> </strong></td>
<%
next
  

%>


  </tr>
  <%
	CurrentPage=replacebadchar(request("page"))
	if CurrentPage="" then
	CurrentPage=1
	else if not IsNumeric(CurrentPage) then
	CurrentPage=1
	else if int(CurrentPage)<=0 then
	CurrentPage=1
	else
 	CurrentPage=replacebadchar(request("page"))
 	end if
	end if
	end if

	maxperpage=10
	
	
	strFileName2="ND_models_popwin_content_selecter.asp?field="&fielda&"&biao="&biaoa&"&serziduan="&serziduana&"&setishi="&setishia&"&nd_x_beisuoziduan_xz="&request("nd_x_beisuoziduan_xz")&"&sskey="&request("sskey")&"&ismohu="&request("ismohu")
		
		
		
		 set rs=server.CreateObject("adodb.recordset")

		 
		 
	sql="select * from "&biaoa&" order by id desc"
		 
	 
		 
if request("nd_x_beisuoziduan_xz")<>"no" and request("nd_x_beisuoziduan_xz")<>"" then 
if cstr(request("ismohu"))="2" then
sql="select * from "&biaoa&"  where ["&request("nd_x_beisuoziduan_xz")&"]='"&trim(request("sskey"))&"' order by id desc"
else
sql="select * from "&biaoa&"  where ["&request("nd_x_beisuoziduan_xz")&"] like '%"&trim(request("sskey"))&"%' order by id desc"
end if
end if



		  rs.open  sql,conn,1,1	 
		 
		 if not rs.eof then
		rs.pagesize=MaxPerpage
		totalnumber=rs.recordcount
		if totalnumber mod maxperpage=0 then
    	MaxPage= totalnumber \ MaxPerpage
  	else
    	MaxPage= totalnumber \ MaxPerpage+1
  	end if
		if int(CurrentPage)>int(MaxPage) then
		CurrentPage=MaxPage
		else
		CurrentPage=CurrentPage
		end if
		Rs.absolutepage=CurrentPage
		for ni=1 to MaxPerpage
		if rs.eof then exit for
  %>
  
  
  
  <tr onmouseover="this.style.backgroundColor='#F3F3FA';this.style.color='red'" onmouseout="this.style.backgroundColor='';this.style.color=''" align="center">
    


  <td bgcolor="#D9D9D9"><input type="button" onclick="selit('<%=rs("id")%>','<%=get_value_by_id_inbiao(biaoa,rs("id"),serziduana)%>')" value="选择此内容"></td>
   <%
   

  for zi2=0 to rs.fields.count - 1 
  if len(cstr(rs.fields(zi2).value&""))>120 then
  sssddd=left(cstr(rs.fields(zi2).value&""),120)&"....."
  else
  sssddd=rs.fields(zi2).value
  end if
  
  
  %>
 <td width="775" height="25" bgcolor="#F1F4FC"><strong><%=server.HTMLEncode(cstr(sssddd&""))%> </strong></td>
<%
next
  

%>




  </tr>
  <%
  rs.movenext
		  next
		  else%>
		 <tr>
        <td height="25" colspan="30" align="center" bgcolor="#F1F4FC"><strong>还没有内容</strong></td>
  </tr>
		  <%end if%>
		          <tr>
        <td height="35" colspan="30" align="center" bgcolor="#F1F4FC" class="showPage"><%call showpage(strFileName2,totalnumber,MaxPerPage,flase,true,"条",CurrentPage)%></td>
      </tr>
</table>







<%

end if

%>